<template>
	<view>
		<view class="plr-3 bg-white">
			<view v-for="(item, index) in qaData" :key="index" @click="itemClick(item, index)" class="list flex justify-between align-center">
				<view class="text-s2 text-c1">{{item.title}}</view>
				<view class="cuIcon-right text-s3"></view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				qaData: [{
					content: '<p style="text-align: left;">这是如何提现</p>↵<p style="text-align: left;"><img src="http://127.0.0.1:8080/tmpl/file/app/qa/4f0f6172725f408e969852c921c9eabe.jpg" alt="" data-href="" />啊撒飞洒的 昂是</p>',
					createTime: "2023-04-01T01:00:00.000+0000",
					id: "402881e68316e9b2018316f44ddd0003",
					title: "如何提现",
					updateTime: "2023-04-01T01:00:00.000+0000",
				},{
					content: '<p><video controls="controls" width="300" height="150">↵<source src="http://127.0.0.1:11020/server/file/app/qa/55e9c3bf3eaa4e74b27498e1eaef7922.mp4" type="video/mp4" /></video></p>',
					createTime: "2023-04-01T01:00:00.000+0000",
					id: "402881eb835fa26001835fa81e3e0007",
					title: "如何注册登录(视频)",
					updateTime: "2023-04-01T01:00:00.000+0000",
				},{
					content: '<p style="text-align: center;"><img src="http://223491r18g.iask.in/tmpl/file/app/qa/8af6eeacd9c14fa7838d6ab1899e9e7a.jpg" alt="" data-href="" style="">如何提现(仅在提现页面展示)</p><p style="text-align: center;"><br></p>',
					createTime: "2023-04-01T01:00:00.000+0000",
					id: "402881e68316e9b2018316f4999b0004",
					tags: "提现",
					title: "如何提现(仅在提现页面展示)",
					updateTime: "2023-04-01T01:00:00.000+0000",
				}],
				tags: '',
				params:{
					tags:""
				}
			};
		},
		onLoad(param) {
			if(param.hasOwnProperty("tags")){
				this.params.tags = param.tags
			}
			// 若有接口,可以放开注释
			// this.initData()
		},
		methods: {
			initData() {
				uni.$api.appQAList({
					tags: this.tags
				}).then(res=>{
					this.qaData = res
				})
			},
			itemClick(item, index) {
				uni.$common.navTo("/subpkg/commons/web-show/web-show", {
					type:"HTML",
					title: item.title,
					content:encodeURIComponent(item.content)
				})
			},
		}
	}
</script>

<style lang="scss">
.list{
	padding: 35rpx 0;
	&:not(:last-child){
		border-bottom: 2rpx solid #D8D8D8;
	}
}
</style>
